var i = function(i) {
    return i && i.__esModule ? i : {
        default: i
    };
}(require("../../../utils/api2"));

Page({
    data: {
        versions: [ {
            version: "企业官网型",
            hot: !0,
            vid: 1
        }, {
            version: "企业电商型",
            hot: !0,
            vid: 2
        }, {
            version: "企业展示型",
            vid: 3
        }, {
            version: "服务预约型",
            vid: 4
        }, {
            version: "全功能旗舰型",
            vid: 5
        }, {
            version: "单页展示型",
            vid: 0
        } ],
        activeVid: 1
    },
    onLoad: function() {
        this.loadTplList(this.data.activeVid);
    },
    loadTplList: function(t) {
        var e = this;
        i.default.site.template.gettpllistsbyversion({
            data: {
                version: t
            },
            desc: "加载中"
        }).then(function(i) {
            e.setData({
                activeVid: t,
                list: i.lists
            });
        });
    },
    switchVersion: function(i) {
        this.loadTplList(i.currentTarget.dataset.version);
    }
});